Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ora

Package Overview
Dependencies
Maintainers
1
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ora

Elegant terminal spinner

  • 5.4.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
32M
increased by3.5%
Maintainers
1
Weekly downloads
 
Created

What is ora?

The ora npm package is a terminal spinner for Node.js applications. It provides an easy way to display a spinner in the command line interface (CLI) during the execution of long-running tasks, giving users a visual cue that processing is taking place. It is highly customizable and can be used to enhance the user experience in CLI tools.

What are ora's main functionalities?

Basic spinner

This code sample demonstrates how to create a basic spinner that starts with a message, runs for a specified duration, and then marks the operation as successful.

const ora = require('ora');

const spinner = ora('Loading unicorns').start();

setTimeout(() => {
  spinner.succeed('Unicorns loaded');
}, 1000);

Customize spinner color, text, and spinner

This code sample shows how to customize the spinner's appearance by setting the color, text, and spinner design. It also demonstrates how to update these properties while the spinner is running.

const ora = require('ora');

const spinner = ora({
  text: 'Loading rainbows',
  color: 'magenta',
  spinner: 'moon'
}).start();

setTimeout(() => {
  spinner.color = 'yellow';
  spinner.text = 'Loading sun';
}, 1000);

Control spinner success and failure

This code sample illustrates how to control the spinner to indicate success or failure of an operation. In this case, the spinner is stopped with a failure message.

const ora = require('ora');

const spinner = ora('Loading with great anticipation').start();

setTimeout(() => {
  spinner.fail('Something went wrong');
}, 1000);

Other packages similar to ora

Keywords

FAQs

Package last updated on 08 Jun 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc